package ae.pcfc.cldos.online.common.strategy.transfer.providers;

import ae.pcfc.cldos.online.common.clddb.domain.AppMetaData;
import ae.pcfc.cldos.online.common.clddb.domain.EmploymentVisaRenew;
import ae.pcfc.cldos.online.common.strategy.transfer.BaseTransferStrategy;
import ae.pcfc.cldos.online.common.vo.TransferDataVO;
import ae.pcfc.cldos.online.net.service.vo.AppMetaDataVO;
import ae.pcfc.cldos.online.net.service.vo.ApplicationDataVO;
import ae.pcfc.cldos.online.net.service.vo.RenewEmployeeDataVO;

/**
 * 
 * @author arosa
 *
 */
public class RenewEmploymentVisaTransferStrategyImpl extends BaseTransferStrategy {

	public String transferAppDateToOfflineSystem(TransferDataVO transferDataVO) {
		
		ApplicationDataVO applicationDataVO = new ApplicationDataVO();
		
		AppMetaData appMetaData = transferDataVO.getAppMetaData();
		EmploymentVisaRenew employeeVisaRenew= appMetaData.getEmploymentVisaRenew();
		
		AppMetaDataVO appMetaDataVO = new AppMetaDataVO();
		mapper.map(appMetaData, appMetaDataVO);
		appMetaDataVO.setEmployeeId(employeeVisaRenew.getEvrEmployeeId());
		applicationDataVO.setAppMetaDataVO(appMetaDataVO);
		
		RenewEmployeeDataVO renewEmployeeDataVO = new RenewEmployeeDataVO();
		renewEmployeeDataVO.setRenewalType(employeeVisaRenew.getEvrRenewalType());
		applicationDataVO.setRenewEmployeeDataVO(renewEmployeeDataVO);
		
		
		applicationDataVO.setAttachmentVOList(getAttachmentsList(appMetaData));
		
		return netDataTransferService.transferRenewEmploymentVisaData(applicationDataVO);
	}
}
